package com.weiz.example01.controller;

import com.weiz.example01.model.Student;
import com.weiz.example01.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    StudentRepository studentRepository;

    @RequestMapping("/findById/{id}")
    public Student findById(@PathVariable Long id){
        return studentRepository.findById(id);
    }
}
